package com.chan.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chan.mapper.CdDetailetrackMapper;
import com.chan.domain.CdDetailetrack;
import com.chan.service.ICdDetailetrackService;
import com.chan.common.core.text.Convert;
import com.chan.common.utils.DateUtils;

/**
 * 需求跟踪Service业务层处理
 *
 * @author chan
 * @date 2024-04-29
 */
@Service
public class CdDetailetrackServiceImpl implements ICdDetailetrackService
{
    @Autowired
    private CdDetailetrackMapper cdDetailetrackMapper;

    /**
     * 查询需求跟踪
     *
     * @param id 需求跟踪主键
     * @return 需求跟踪
     */
    @Override
    public CdDetailetrack selectCdDetailetrackById(Long id)
    {
        return cdDetailetrackMapper.selectCdDetailetrackById(id);
    }

    /**
     * 查询需求跟踪列表
     *
     * @param cdDetailetrack 需求跟踪
     * @return 需求跟踪
     */
    @Override
    public List<CdDetailetrack> selectCdDetailetrackList(CdDetailetrack cdDetailetrack)
    {
        return cdDetailetrackMapper.selectCdDetailetrackList(cdDetailetrack);
    }

    /**
     * 新增需求跟踪
     *
     * @param cdDetailetrack 需求跟踪
     * @return 结果
     */
    @Override
    public int insertCdDetailetrack(CdDetailetrack cdDetailetrack)
    {
        cdDetailetrack.setCreateTime(DateUtils.getNowDate());
        return cdDetailetrackMapper.insertCdDetailetrack(cdDetailetrack);
    }

    /**
     * 修改需求跟踪
     *
     * @param cdDetailetrack 需求跟踪
     * @return 结果
     */
    @Override
    public int updateCdDetailetrack(CdDetailetrack cdDetailetrack)
    {
        cdDetailetrack.setUpdateTime(DateUtils.getNowDate());
        return cdDetailetrackMapper.updateCdDetailetrack(cdDetailetrack);
    }

    /**
     * 批量删除需求跟踪
     *
     * @param ids 需要删除的需求跟踪主键
     * @return 结果
     */
    @Override
    public int deleteCdDetailetrackByIds(String ids)
    {
        return cdDetailetrackMapper.deleteCdDetailetrackByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除需求跟踪信息
     *
     * @param id 需求跟踪主键
     * @return 结果
     */
    @Override
    public int deleteCdDetailetrackById(Long id)
    {
        return cdDetailetrackMapper.deleteCdDetailetrackById(id);
    }
}
